const asyncHandle = require('express-async-handler')
const responseHelper = (fn) => {
  return asyncHandle(async (req, res) => {
    const data = await fn(req, res)
    res.json({
      code: 0,
      data: data,
    })
  })
}

module.exports = {
  responseHelper,
}
